package com.longjianghuasheng.logistics.business.billing_period.fragment

import androidx.lifecycle.MutableLiveData
import com.longjianghuasheng.logistics.base.BaseMultiStateViewModel
import com.longjianghuasheng.logistics.data.model.bean.ApiResponseNoData
import com.longjianghuasheng.logistics.entity.AccountResponse
import com.longjianghuasheng.logistics.ext.commit2
import com.longjianghuasheng.logistics.network.apiService

class AccountOpeningViewModel : BaseMultiStateViewModel() {

    var isAccount = false

    val result by lazy {
        MutableLiveData<ApiResponseNoData>()
    }


    fun account() {

        commit2({ apiService.account() }, result)
    }


    val bannerResult by lazy {
        MutableLiveData<ArrayList<String>>()
    }


    fun banner() {

        getData({ apiService.banner(3) }, bannerResult)
    }


    val accountResult by lazy {
        MutableLiveData<AccountResponse>()
    }

    fun account_data() {

        commit2({ apiService.account_data() }, accountResult, isToastSuccess = false, isShowDialog = false)
    }


}